package com.matt.domain.vo;

import com.matt.commons.model.Domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * *********************
 * description :合同Vo类
 * Created by Ron
 * from com.matt
 * on 2018/6/20 0020.
 * *********************
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ContractVo extends Domain {

    private String id;

    private Boolean deleted;

    private Date created;

    @ApiModelProperty(value = "合同名称")
    private String name;

    @ApiModelProperty(value = "合同编码")
    private String code;

    @ApiModelProperty(value = "开始时间")
    private Date beginDate;

    @ApiModelProperty(value = "合同状态")
    private Integer status = 1;

    @ApiModelProperty(value = "合同状态0：未开始 1。正常， 2：已终止, 3：已结束 4:待补款")
    private String statusVal;

    @ApiModelProperty(value = "结束时间")
    private Date endDate;

    @ApiModelProperty(value = "签单时间")
    private Date signDate;

    @ApiModelProperty(value = "付款方式 1:现金 2:刷卡 3:银行转账 4:支付宝 5:微信 6:其他")
    private Integer payChannel = 1;

    @ApiModelProperty(value = "付款方式文本")
    private String payChannelVal;

    @ApiModelProperty(value = "总金额")
    private BigDecimal totalAmount = BigDecimal.ZERO;

    //付款状态
    @ApiModelProperty(value = "付款状态0：未付清 1：已付清")
    private Integer payStatus = 0;

    //付款状态
    @ApiModelProperty(value = "付款状态0：未付清 1：已付清")
    private String payStatusVal = "未付清";

    @ApiModelProperty(value = "付款类型 1:定金 2:全款 3:线上收款")
    private Integer payType = 1;

    @ApiModelProperty(value = "付款类型 1:线下定金 2:线下全款 3:线上收款")
    private String payTypeVal;

    @ApiModelProperty(value = "已支付金额")
    private BigDecimal practicalAmount = BigDecimal.ZERO;

    @ApiModelProperty(value = "附件地址")
    private String attachmentUrl;

    @ApiModelProperty(value = "客户id")
    private String clienteleId;

    @ApiModelProperty(value = "园区id")
    private String areaId;

    @ApiModelProperty(value = "合同类型")
    private Integer type = 1;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "员工ID")
    private String staffId;

    @ApiModelProperty(value = "最后更新时间")
    private Date lastModified;

    @ApiModelProperty(value = "最后更新人")
    private String lastModifiedId;


    @ApiModelProperty(value = "中止原因")
    private String breakDownReason;

    @ApiModelProperty(value = "中止备注")
    private String breakDownRemark;

    @ApiModelProperty(value = "最终回款时间")
    private Date paidDate;

    //用于统计
    @Column(columnDefinition = "bit default 0 COMMENT '是否是续约合同 0:不是，1:是'")
    @ApiModelProperty(value = "创建人姓名")
    private Boolean isRenewal = false;

    @ApiModelProperty(value = "合同渠道 0:原教务导入， 1：crm新建")
    private Integer fromChannel = 1;

    //冗余字段
    @ApiModelProperty(value = "创建人姓名")
    private String staffName;

    private Integer clienteleStatus; //跟进状态

    @ApiModelProperty(value = "剩余可请假延长合同天数")
    private Integer signStatus; //成交状态

    @ApiModelProperty(value = "剩余可请假延长合同天数")
    private Integer surplusLeaveDay = 10;


}
